package com.sso.portal;

import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;

@SpringBootApplication
public class PortalSystemApplication {
    public static void main(String[] args) {
        SpringApplication.run(PortalSystemApplication.class, args);
    }
    
    @Bean
    public ApplicationRunner applicationRunner(Environment environment) {
        return args -> {
            String port = environment.getProperty("server.port");
            String contextPath = environment.getProperty("server.servlet.context-path");
            String url = "http://www.oauth2server.com:" + port + contextPath;
            
            System.out.println("\n=======================================================");
            System.out.println("    企业统一门户系统启动成功！");
            System.out.println("    访问地址: " + url);
            System.out.println("    系统功能: 统一登录入口、OA系统跳转、风控系统跳转");
            System.out.println("=======================================================\n");
        };
    }
}
